diff --git a/CMakeLists.txt b/CMakeLists.txt index 62bf203..7d459fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,8 +18,8 @@ IF(NOT WIN32) SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Coverage." FORCE) - ENDIF(NOT CMAKE_BUILD_TYPE) -ENDIF(NOT WIN32) + ENDIF() +ENDIF() SET(DEBUG_LIBNAME_SUFFIX "" CACHE STRING "Optional suffix to append to the library name for a debug build") SET(LIB_SUFFIX "" CACHE STRING "Optional arch-dependent suffix for the library installation directory") @@ -39,7 +39,7 @@ MARK_AS_ADVANCED( RUNTIME_INSTALL_DIR ARCHIVE_INSTALL_DIR INCLUDE_INSTALL_DIR PA # Set variable named ${VAR_NAME} to value ${VALUE} FUNCTION(set_using_dynamic_name VAR_NAME VALUE) SET( "${VAR_NAME}" "${VALUE}" PARENT_SCOPE) -ENDFUNCTION(set_using_dynamic_name) +ENDFUNCTION() # Extract major, minor, patch from version text # Parse a version string "X.Y.Z" and outputs @@ -55,8 +55,8 @@ MACRO(jsoncpp_parse_version VERSION_TEXT OUPUT_PREFIX) set_using_dynamic_name( "${OUPUT_PREFIX}_FOUND" TRUE ) ELSE( ${VERSION_TEXT} MATCHES ${VERSION_REGEX} ) set_using_dynamic_name( "${OUPUT_PREFIX}_FOUND" FALSE ) - ENDIF( ${VERSION_TEXT} MATCHES ${VERSION_REGEX} ) -ENDMACRO(jsoncpp_parse_version) + ENDIF() +ENDMACRO() # Read out version from "version" file #FILE(STRINGS "version" JSONCPP_VERSION) @@ -83,7 +83,7 @@ macro(UseCompilationWarningAsError) # Only enabled in debug because some old versions of VS STL generate # warnings when compiled in release configuration. set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /WX ") - endif( MSVC ) + endif() endmacro() # Include our configuration header @@ -93,12 +93,12 @@ if ( MSVC ) # Only enabled in debug because some old versions of VS STL generate # unreachable code warning when compiled in release configuration. set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W4 ") -endif( MSVC ) +endif() if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # using regular Clang or AppleClang set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wconversion -Wshadow -Wno-sign-conversion") -elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") +elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # using GCC set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wconversion -Wshadow -Wextra -pedantic") # not yet ready for -Wsign-conversion @@ -106,7 +106,7 @@ endif() IF(JSONCPP_WITH_WARNING_AS_ERROR) UseCompilationWarningAsError() -ENDIF(JSONCPP_WITH_WARNING_AS_ERROR) +ENDIF() IF(JSONCPP_WITH_PKGCONFIG_SUPPORT) CONFIGURE_FILE( @@ -115,13 +115,13 @@ IF(JSONCPP_WITH_PKGCONFIG_SUPPORT) @ONLY) INSTALL(FILES "${CMAKE_BINARY_DIR}/pkg-config/jsoncpp.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig") -ENDIF(JSONCPP_WITH_PKGCONFIG_SUPPORT) +ENDIF() IF(JSONCPP_WITH_CMAKE_PACKAGE) INSTALL(EXPORT jsoncpp DESTINATION ${PACKAGE_INSTALL_DIR}/jsoncpp FILE jsoncppConfig.cmake) -ENDIF(JSONCPP_WITH_CMAKE_PACKAGE) +ENDIF() # Build the different applications ADD_SUBDIRECTORY( src ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 608d3f7..ca8ac15 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,4 +2,4 @@ ADD_SUBDIRECTORY(lib_json) IF(JSONCPP_WITH_TESTS) ADD_SUBDIRECTORY(jsontestrunner) ADD_SUBDIRECTORY(test_lib_json) -ENDIF(JSONCPP_WITH_TESTS) +ENDIF() diff --git a/src/jsontestrunner/CMakeLists.txt b/src/jsontestrunner/CMakeLists.txt index 820a7cd..20d01e6 100644 --- a/src/jsontestrunner/CMakeLists.txt +++ b/src/jsontestrunner/CMakeLists.txt @@ -9,7 +9,7 @@ IF(BUILD_SHARED_LIBS) TARGET_LINK_LIBRARIES(jsontestrunner_exe jsoncpp_lib) ELSE(BUILD_SHARED_LIBS) TARGET_LINK_LIBRARIES(jsontestrunner_exe jsoncpp_lib_static) -ENDIF(BUILD_SHARED_LIBS) +ENDIF() SET_TARGET_PROPERTIES(jsontestrunner_exe PROPERTIES OUTPUT_NAME jsontestrunner_exe) @@ -22,4 +22,4 @@ IF(PYTHONINTERP_FOUND) DEPENDS jsontestrunner_exe jsoncpp_test ) ADD_CUSTOM_TARGET(jsoncpp_check DEPENDS jsoncpp_readerwriter_tests) -ENDIF(PYTHONINTERP_FOUND) +ENDIF() diff --git a/src/lib_json/CMakeLists.txt b/src/lib_json/CMakeLists.txt index 79ffa2e..99ddc7f 100644 --- a/src/lib_json/CMakeLists.txt +++ b/src/lib_json/CMakeLists.txt @@ -37,7 +37,7 @@ IF(JSONCPP_WITH_CMAKE_PACKAGE) SET(INSTALL_EXPORT EXPORT jsoncpp) ELSE(JSONCPP_WITH_CMAKE_PACKAGE) SET(INSTALL_EXPORT) -ENDIF(JSONCPP_WITH_CMAKE_PACKAGE) +ENDIF() IF(BUILD_SHARED_LIBS) ADD_DEFINITIONS( -DJSON_DLL_BUILD ) @@ -55,7 +55,7 @@ IF(BUILD_SHARED_LIBS) TARGET_INCLUDE_DIRECTORIES( jsoncpp_lib PUBLIC $ $) - ENDIF(NOT CMAKE_VERSION VERSION_LESS 2.8.11) + ENDIF() ENDIF() @@ -75,6 +75,6 @@ IF(BUILD_STATIC_LIBS) $ $ ) - ENDIF(NOT CMAKE_VERSION VERSION_LESS 2.8.11) + ENDIF() ENDIF()