forked from Exiv2/exiv2
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Helps to keep the CMake stuff consistent. Signed-off-by: Rosen Penev <rosenp@gmail.com>
- Loading branch information
Showing
9 changed files
with
554 additions
and
538 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
with section("format"): | ||
|
||
# How wide to allow formatted cmake files | ||
line_width = 150 | ||
|
||
# How many spaces to tab for indent | ||
tab_size = 2 | ||
|
||
# If true, separate flow control names from their parentheses with a space | ||
separate_ctrl_name_with_space = False | ||
|
||
# If true, separate function names from parentheses with a space | ||
separate_fn_name_with_space = False | ||
|
||
# If a statement is wrapped to more than one line, than dangle the closing | ||
# parenthesis on its own line. | ||
dangle_parens = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,62 @@ | ||
add_executable( exiv2 | ||
exiv2.cpp | ||
exiv2app.hpp | ||
actions.cpp actions.hpp | ||
getopt.cpp getopt.hpp | ||
app_utils.cpp app_utils.hpp | ||
add_executable( | ||
exiv2 | ||
exiv2.cpp | ||
exiv2app.hpp | ||
actions.cpp | ||
actions.hpp | ||
getopt.cpp | ||
getopt.hpp | ||
app_utils.cpp | ||
app_utils.hpp | ||
) | ||
|
||
target_include_directories(exiv2 PRIVATE ${PROJECT_SOURCE_DIR}/src) # To find i18n.hpp | ||
|
||
set_target_properties( exiv2 PROPERTIES | ||
COMPILE_FLAGS ${EXTRA_COMPILE_FLAGS} | ||
XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS[variant=Debug] "YES" | ||
) | ||
if (MSVC) | ||
set_target_properties(exiv2 PROPERTIES LINK_FLAGS "/ignore:4099") # Ignore missing PDBs | ||
set_target_properties(exiv2 PROPERTIES COMPILE_FLAGS ${EXTRA_COMPILE_FLAGS} XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS[variant=Debug] "YES") | ||
if(MSVC) | ||
set_target_properties(exiv2 PROPERTIES LINK_FLAGS "/ignore:4099") # Ignore missing PDBs | ||
endif() | ||
|
||
target_link_libraries( exiv2 PRIVATE exiv2lib ) | ||
target_link_libraries(exiv2 PRIVATE exiv2lib) | ||
|
||
if( EXIV2_ENABLE_NLS ) | ||
target_link_libraries(exiv2 PRIVATE ${Intl_LIBRARIES}) | ||
target_include_directories(exiv2 PRIVATE ${Intl_INCLUDE_DIRS}) | ||
if(EXIV2_ENABLE_NLS) | ||
target_link_libraries(exiv2 PRIVATE ${Intl_LIBRARIES}) | ||
target_include_directories(exiv2 PRIVATE ${Intl_INCLUDE_DIRS}) | ||
endif() | ||
|
||
target_link_libraries(exiv2 PRIVATE std::filesystem) | ||
|
||
if(MSVC OR MINGW) | ||
# Trick to get properly UTF-8 encoded argv | ||
# More info at: https://github.com/huangqinjin/wmain | ||
add_library(wmain STATIC wmain.cpp) | ||
target_link_libraries(exiv2 PRIVATE wmain) | ||
# Trick to get properly UTF-8 encoded argv More info at: https://github.com/huangqinjin/wmain | ||
add_library(wmain STATIC wmain.cpp) | ||
target_link_libraries(exiv2 PRIVATE wmain) | ||
endif() | ||
|
||
if (MSVC) | ||
target_link_options(wmain INTERFACE /WHOLEARCHIVE:$<TARGET_FILE:wmain>) | ||
target_link_options(exiv2 PRIVATE "/ENTRY:wWinMainCRTStartup") | ||
if(MSVC) | ||
target_link_options(wmain INTERFACE /WHOLEARCHIVE:$<TARGET_FILE:wmain>) | ||
target_link_options(exiv2 PRIVATE "/ENTRY:wWinMainCRTStartup") | ||
endif() | ||
|
||
if (MINGW) | ||
target_compile_options(exiv2 PRIVATE -municode) | ||
target_link_options(exiv2 PRIVATE -municode) | ||
if(MINGW) | ||
target_compile_options(exiv2 PRIVATE -municode) | ||
target_link_options(exiv2 PRIVATE -municode) | ||
endif() | ||
|
||
if (USING_CONAN AND WIN32 AND EXISTS ${PROJECT_BINARY_DIR}/conanDlls) | ||
# In case of using conan recipes with their 'shared' option turned on, we will have dlls of | ||
# the 3rd party dependencies in the conanDlls folder. | ||
if(USING_CONAN | ||
AND WIN32 | ||
AND EXISTS ${PROJECT_BINARY_DIR}/conanDlls | ||
) | ||
# In case of using conan recipes with their 'shared' option turned on, we will have dlls of the 3rd party dependencies in the conanDlls folder. | ||
|
||
# Copy 3rd party DLLs the bin folder. [build step] | ||
add_custom_command(TARGET exiv2 POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_BINARY_DIR}/conanDlls ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) | ||
add_custom_command( | ||
TARGET exiv2 | ||
POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_BINARY_DIR}/conanDlls ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} | ||
COMMENT "Copy 3rd party DLLs the bin folder" | ||
) | ||
|
||
# Copy 3rd party DLLs the bin folder. [install step] | ||
install(DIRECTORY ${PROJECT_BINARY_DIR}/conanDlls/ DESTINATION bin) | ||
# Copy 3rd party DLLs the bin folder. [install step] | ||
install(DIRECTORY ${PROJECT_BINARY_DIR}/conanDlls/ DESTINATION bin) | ||
endif() | ||
|
||
install(TARGETS exiv2 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) |
Oops, something went wrong.